#include <bits/stdc++.h>
using namespace std;
 
int main()
{
	vector<int> aa = { 1,2,4,3,8,6,1,4 };
	priority_queue<int, vector<int>, greater<int>> pq;//, vector<int>
	for (int i = 0; i < aa.size(); i++) {
		pq.push(aa[i]);
	}
	sort(aa.begin(), aa.end());
	for (int i = 0; i < aa.size(); i++)
		cout << aa[i] << "\t";
	cout<<endl;
	for (int i = 0; i < aa.size(); i++){

		cout << pq.top() << "\t";
	    pq.pop();
    }	
	return 0;
}